﻿@{
    ViewBag.Title = "Edit";
}

<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
//        $(document).ready(function () {
//            $('a').each(function () {
//                //$(this).mousedown(function (event) {
//                $(this).bind('mousedown', function (e) {
//                    if ((e.which == 1)) {
//                        alert("left button");
//                    }
//                    if ((e.which == 3)) {
//                        alert("right button");
//                    }
//                    else if ((e.which == 2)) {
//                        alert("middle button");
//                    }
//                    e.preventDefault();
//                });
//            });
//        });

        document.ready = bindEvents;
        function bindEvents() {
            var elements = document.getElementsByTagName('a');
            for (i = 0; i < elements.length; i++) {
                var element = elements[i];
                element.onmousedown = doSomething;
            } 
        }
        function doSomething(e) {
            alert('asdfsadf');
            if (!e) var e = window.event;
            //var relTarg = e.relatedTarget || e.fromElement;
            //alert(e.which);
            if ((e.which == 1)) {
                alert("left button");
            }
            if ((e.which == 3)) {
                alert("right button");
            }
            else if ((e.which == 2)) {
                alert("middle button");
            }
            e.preventDefault();
        }
    </script>
</head>
<body>
    <div class="page">
        <div id="header">
            <div id="title">
                <h1>My Test Application</h1>
                @*<h2>Edit</h2>*@
            </div>
            <div id="logindisplay">
                Log In Message    
            </div>
            <div id="menucontainer">
                <ul id="menu">
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    <li>@Html.ActionLink("About", "About", "Home")</li>
                </ul>
            </div>
        </div>
        <div id="main">
            <div>@ViewBag.Message</div>   
            <a href="/Private/Product/Edit/0" onclick="alert('Button Clicked');">Product Edit</a>
        </div>
        <div id="footer">
        </div>
    </div>
</body>
</html>